apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ $.Chart.Name }}
  namespace: {{ index .Values "logstash" "namespace" }}
data:
  logstash.yml: |-
    http.host: "0.0.0.0"
    path.config: /usr/share/logstash/pipeline/
    xpack.monitoring.enabled: false
    log.level: warn
  jvm.options: |-
    -Xms2g
    -Xmx2g

    ## GC configuration
    -XX:+UseParNewGC
    -XX:+UseConcMarkSweepGC
    -XX:CMSInitiatingOccupancyFraction=75
    -XX:+UseCMSInitiatingOccupancyOnly

    # set to headless, just in case
    -Djava.awt.headless=true

    # ensure UTF-8 encoding by default (e.g. filenames)
    -Dfile.encoding=UTF-8

    # Turn on JRuby invokedynamic
    -Djruby.compile.invokedynamic=true
    # Force Compilation
    -Djruby.jit.threshold=0

    # generate a heap dump when an allocation from the Java heap fails
    # heap dumps are created in the working directory of the JVM
    -XX:+HeapDumpOnOutOfMemoryError

    # Entropy source for randomness
    -Djava.security.egd=file:/dev/urandom